#include "TCPInfor.h"

void email::TCPInfor::parse(QString str)
{
	QRegExp re;
	re.setPattern(email::pattern::TCP_INFO);
	re.indexIn(str);
	if (re.cap(2).compare("") != 0)
	{
		email::TCPInfor::address.parse(re.cap(2));
		email::TCPInfor::addressLiteral.parse(re.cap(3));
	} 
	else
	{
		email::TCPInfor::address.parse(re.cap(2));
		email::TCPInfor::addressLiteral.parse(re.cap(1));
	}

}